[mirrors]
https://github.com/norayr/voc/archive/8b66c787da358c76b141503cc9e09f5292ca856d.tar.gz

[vars]
filesize=4219332
sha512=9b89c92d432df748fae377ec73a8f41a56c3c363a49b71d10da7b2ad28c72c6d5653419d531b64889143e62c48c2849e5fb299cacf7cf4e110c9bb82584a5a62
tardir=voc-8b66c787da358c76b141503cc9e09f5292ca856d

[deps.host]
sed

[build]
patch() {
   sed -i "s@PRF = \"/opt\"@PRF = \"$butch_root_dir$butch_prefix/opt\"@" $1
   sed -i 's@PREFIX = $(PRF)/voc-$(RELEASE)@PREFIX = $(PRF)/voc@' $1
   sed -i 's@PREFIXLN = $(PRF)/voc@@' $1
}
compile() {
   patch $1
   make -f $1
}

patch makefile
sed -i 's@ln -s $(PREFIX) $(PREFIXLN)@@' makefile
sed -i 's@rm -rf $(PREFIXLN)@@' makefile
sed -i 's@echo "$(PREFIX)/lib" > 05vishap.conf@@' makefile
sed -i 's@cp 05vishap.conf /etc/ld.so.conf.d/@@' makefile
sed -i 's@ldconfig@@' makefile

sed -i 's@("/voc-", prefix)@("/voc", prefix)@' src/voc/version.Mod
sed -i 's@Strings.Append(version, prefix).*@@' src/voc/version.Mod

if [ "$CC" = "gcc" ] ; then
   case "$A" in
      arm) compile makefile.linux.gcc.armv6j_hardfp ;;
      powerpc) compile  makefile.linux.gcc.powerpc ;;
      i386) compile  makefile.linux.gcc.x86 ;;
      x86_64) compile makefile.linux.gcc.x86_64 ;;
      *) echo "error: Not a supported arch!" && exit 1 ;;
   esac
elif [ "$CC" = "clang" ] ; then
   case "$A" in
      powerpc) compile makefile.linux.clang.powerpc ;;
      x86_64) compile makefile.linux.clang.x86_64 ;;
      *) echo "error: Not a supported arch!" && exit 1 ;;
   esac
fi 

make install
